package com.zhou.server.impl;

import com.zhou.dao.JDBCUserDao;
import com.zhou.dao.JpaUserRepository;
import com.zhou.pojo.User;
import com.zhou.server.DemoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class DemoServiceImpl implements DemoService {
    @Autowired
    private JDBCUserDao jdbcUserDao;
    @Autowired
    private JpaUserRepository jpaUserRepository;

    @Override
    public Map getMag() {
        return jdbcUserDao.getMsg();
    }

    @Override
    public List<User> getJpaMag() {
        return (List<User>) jpaUserRepository.findAll();
    }

}
